#!/usr/bin/env bash

# 打开 /etc/rsyslog.conf
# systemctl restart syslog
# 查看监听情况 netstat -anltnp


sed -i -e "s/#module(load=\"imudp\")/module(load=\"imudp\")/g" /etc/rsyslog.conf
sed -i -e "s/#input(type=\"imudp\" port=\"514\")/input(type=\"imudp\" port=\"514\")/g" /etc/rsyslog.conf
sed -i -e "s/#module(load=\"imtcp\")/module(load=\"imtcp\")/g" /etc/rsyslog.conf
sed -i -e "s/#input(type=\"imtcp\" port=\"514\")/input(type=\"imtcp\" port=\"514\")/g" /etc/rsyslog.conf


sed -i -e "s/RSYSLOGD_OPTIONS=\"\"/RSYSLOGD_OPTIONS=\"-c5 -r -x\")/g" /etc/default/rsyslog
